import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/firstaid/virtuals/depts/pages',
    method: 'get',
    params: query
  })
}

export function requestOrgs(query) {
  return request({
    url: '/support/institutions/list?orgName=' + query,
    method: 'get'
  })
}

export function saveOrUpdate(virtualcenter) {
  console.log('virtualcenters' + virtualcenter)
  let method = ''
  if (virtualcenter.id === '') {
    method = 'post'
  } else {
    method = 'put'
  }
  return request({
    url: '/firstaid/virtuals/depts',
    method: method,
    data: virtualcenter
  })
}

export function remove(id) {
  return request({
    url: '/firstaid/virtuals/depts/' + id,
    method: 'delete'
  })
}
export function get(id) {
  return request({
    url: '/firstaid/virtuals/depts/' + id,
    method: 'get'
  })
}
